<template>
  <view>
    <view class="item p-tb-30 flex p-lr-20 just-sb" v-for="(g,index) in item.item" :key="index" @tap="jump_detail()">
      <view class="l ovh br-10">
        <image :src="g.goods_image" mode="widthFix" />
      </view>
      <view class="r">
        <view class="tb lh-40">
          {{g.goods_title}}
        </view>
        <view class="m-t-20 ts-24" v-if="g.goods_sku_text">
          规格：{{g.goods_sku_text ? g.goods_sku_text : ""}}
        </view>
        <view class="lh-34 m-t-20">
          <text class="tc-r">￥</text>
          <text class="ts-34 tb tc-r">{{ g.goods_price }}</text>
          <text class="fr">x{{ g.buy_num }}</text>
        </view>
        <view class="lh-34 m-t-50 ts-22" v-if="g.benfit_num>0">
          权益抵扣数量：{{g.benfit_num}}
        </view>
      </view>
    </view>
  </view>
</template>

<script>

export default {
  name: "xyGoodsGrad",
  components: {
  },
  props: {
    item: {
      type: Object,
    },
    jump: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {

    };
  },
  methods: {
    jump_detail(){
      if(this.jump){
        this.$xyfun.to('/pages/shop/goods/detail?id='+this.item.item[0].goods_id)
      }

    }
  }
}
</script>


<style scoped lang="scss">
  .item{
    .l{
      width: 178rpx;height: 178rpx;
      image{width: 178rpx;}
    }
    .r{
      flex-grow: 1;
      margin-left: 20rpx;
    }
  }
</style>
